using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DOJ.LEISP.LEXS.Common.Providers
{
    public class DefaultTextSearchProvider : ITextSearchProvider
    {
        public List<SearchResultPackageType> DoTextSearch(SearchRequestMetadataType searchMetadata, string textQuery, out ResponseMetadataType responseMetadata, out SearchResponseMetadataType searchResponseMetadata)
        {
            responseMetadata = new ResponseMetadataType();
            searchResponseMetadata = new SearchResponseMetadataType();
            
            List<AdvisoryType> advisories = new List<AdvisoryType>();
            AdvisoryType advisory1 = new AdvisoryType { AdvisoryCategory = new AdvisoryCategoryCodeType() };
            advisory1.AdvisoryCategory.Value = AdvisoryCategoryCodeSimpleType.UnstructuredSearchNotSupported;
            advisory1.AdvisoryText = "The service provider only supports structured queries.";
            advisories.Add(advisory1);

            responseMetadata.Advisory = advisories.ToArray();
            responseMetadata.ResultCode = new ResultCodeType { Value = ResultCodeSimpleType.Error };

            searchResponseMetadata = new SearchResponseMetadataType();
            searchResponseMetadata.MaxItemMatchesRequested = searchMetadata.MaxItemMatches;
            searchResponseMetadata.ServerLimitIndicator = false;
            searchResponseMetadata.NumberItemMatches = "0";

            return null;
        }
    }
}
